const Koa = require('koa');
const app = new Koa();

const logger = (ctx, next) => {
  console.log(`${Date.now()}-${ctx.method}-${ctx.url}`);
  next();
}
const main = (ctx, next) => {
  ctx.response.body = 'hello';
}
const one = (ctx, next) => {
  console.log('>>>one');
  next();
  console.log('<<<one');
}
const two = (ctx, next) => {
  console.log('>>>two');
  next();
  console.log('<<<two');
}
const three = (ctx, next) => {
  console.log('>>>three');
  next();
  console.log('<<<three');
}

// app.use(logger);
// app.use(main);
app.use(one);
app.use(two);
app.use(three);

app.listen(3001);